#include "widget.h"
#include "ui_widget.h"
#include <QRect>
#include <QDebug>
#include <QPushButton>
#include <string>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    this->setWindowTitle("这是个自定义名称");
    QIcon tmp_icon(":/dog.jpg");
   this->setWindowIcon(tmp_icon);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    QRect tmp1=this->geometry();
    QRect tmp2=this->frameGeometry();
    qDebug()<<tmp1;
    qDebug()<<tmp2;
}

void Widget::on_pushButton_1_clicked()
{
    double tmp=this->windowOpacity();
    if(tmp >=0 && tmp <=1)
    {
    this->setWindowOpacity(tmp-=0.1);
    }
    qDebug()<<tmp;
}

void Widget::on_pushButton_2_clicked()
{
    double tmp=this->windowOpacity();
    if(tmp <= 1 && tmp >=0)
    {
       this->setWindowOpacity(tmp+=0.1);
    }

    qDebug()<<tmp;
}
